package chapter1.date.task;
/*
2:计算当前时间距“世界末日”已经过去了多少天（2012-12-21）
 */

import java.util.*;

public class Task2 {
    public static void main(String[] args) {
        Calendar calendar1 = Calendar.getInstance();
        calendar1.set(2012, 11, 21);
        Calendar calendar2 = Calendar.getInstance();
        calendar2.setTime(new Date());
        long millisecond1 = calendar1.getTimeInMillis();
        long millisecond2 = calendar2.getTimeInMillis();
        long day = (millisecond2 - millisecond1) / (24 * 60 * 60 * 1000);
        System.out.println("当前距世界末日已过去" + day + "天");

    }
}
